package com.gzhryc.shared_device.oem.code.profit.dao.db;

import java.util.Date;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.DateBranchTable;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.enums.DateBranchTableType;
import com.gzhryc.shared_device.oem.code.business.EBusinessType;

/**
 * 代理介绍人分成记录
 */
@DateBranchTable(type = DateBranchTableType.year)
@Table(name="agent_referrer_order_profit")
public class AgentReferrerOrderProfit {
	
	@Id(auto=false)
	@Column(name = "trade_no", notNull = true)
    protected String tradeNo;
	
	@Column(name = "order_date", notNull = true,note="订单时间")
	protected Date orderDate;

    @Column(name = "user_id",notNull = true,note = "用户ID")
    protected Long userId;
	
	@Column(name = "referrer_user_id", notNull = true,note = "介绍人ID")
    protected Long referrerUserId;
	
	@Column(name="referrer_user_name",length = 32,note = "真实姓名")
	protected String referrerUserName;
	
	@Column(name="referrer_user_phone",length = 16,note = "手机号")
	protected String referrerUserPhone;
	
	@Column(name = "business_type", notNull = true)
	protected String businessType;
	
	@Column(name = "account_group_id", notNull = true, note = "账号组ID")
	protected Long accountGroupId;
	
	@Column(name = "order_profit_money", notNull = true, note = "服务费")
	protected Long orderProfitMoney;
	
	@Column(name = "income_ratio", notNull = true)
	protected Double incomeRatio;
	
	@Column(notNull = true, note = "分成金额")
	protected Long money;
	
	@Column(name = "update_date", autoUpdateTime = true)
	protected Date updateDate;

	@Column(name = "create_date")
	protected Date createDate;

	public String getTradeNo() {
		return tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}

	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getReferrerUserId() {
		return referrerUserId;
	}

	public void setReferrerUserId(Long referrerUserId) {
		this.referrerUserId = referrerUserId;
	}
	
	public String getReferrerUserName() {
		return referrerUserName;
	}

	public void setReferrerUserName(String referrerUserName) {
		this.referrerUserName = referrerUserName;
	}

	public String getReferrerUserPhone() {
		return referrerUserPhone;
	}

	public void setReferrerUserPhone(String referrerUserPhone) {
		this.referrerUserPhone = referrerUserPhone;
	}

	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}

	public Long getAccountGroupId() {
		return accountGroupId;
	}

	public void setAccountGroupId(Long accountGroupId) {
		this.accountGroupId = accountGroupId;
	}

	public Long getOrderProfitMoney() {
		return orderProfitMoney;
	}

	public void setOrderProfitMoney(Long orderProfitMoney) {
		this.orderProfitMoney = orderProfitMoney;
	}

	public Double getIncomeRatio() {
		return incomeRatio;
	}

	public void setIncomeRatio(Double incomeRatio) {
		this.incomeRatio = incomeRatio;
	}

	public Long getMoney() {
		return money;
	}

	public void setMoney(Long money) {
		this.money = money;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	public String getMoneyStr() {
		return NumberTools.getMoneyLiStr(this.money);
	}
	
	public String getBusinessTypeName() {
		return EBusinessType.note(this.businessType);
	}
}
